package com.jm.controller;

import com.jm.model.Order;
import com.jm.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {


    @Resource
    private OrderService orderService;

    @PostMapping("/createOrder")
    void createOrder(@RequestBody Order order) {
        log.info("请求订单微服务：{}", order.toString());
        orderService.createOrder(order);
    }
}

